package cn.jdy.common.constant;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import cn.jdy.framework.util.DateUtil;

/**
 * 全局常量/参数类
 * 
 * @author: zhaiguangtao
 * @data: 2010-8-2
 */
public class GlobalConstant {

  /**
   * 产品版本号：web admin app 统一使用此配置<br/>
   * 版本号来源：暂定每次发布手动修改， 后期实现自动化<br/>
   * 版本号规则：暂定 1.0.1betaN 每次发布N++<br/>
   */
  public static final String VERSION = "1.0.1beta"+DateUtil.getCurrentDate3();

  /**
   * 系统类型
   */
  public static final String OSNAME = System.getProperty("os.name");
  
  /**
   * 登录用户常量
   */
  public static final String SESSION_USER = "sessionUser";
  
  /**
   * 手机验证码
   */
  public static final String _PHONECODE = "_phonecode";
  // 超级管理员ID
  public static final String SUPER_OPER_ID = "1";
  
  /**
   * 项目类的根路径 D:/Program%20Files/tomcat/webapps/项目名/WEB-INF/classes/ 
   * */
  public static final String PROJECT_CLASS_PATH = GlobalConstant.class.getClassLoader().getResource("/").getFile().replaceAll("%20", " "); 
  
  /**
   * WEB-INF的路径 D:/Program%20Files/tomcat/webapps/项目名/WEB-INF/
   *  */
  public static final String PROJECT_WEBINF_PATH = PROJECT_CLASS_PATH.replaceAll("WEB-INF/.*", "WEB-INF/");
  
  /**
   * webapps的路径 D:/Program%20Files/tomcat/webapps/
   *  */
  public static final String PROJECT_WEBAPPS_PATH = PROJECT_CLASS_PATH.replaceAll("webapps/.*", "webapps/");
  
  /**
   * 文件上传目录的路径 D:/Program%20Files/tomcat/upload/
   *  */
  public static final String PROJECT_UPLOAD_PATH = PROJECT_WEBAPPS_PATH+"upload/";
  
  
  public static final String PRO_FILE_CONFIG = "private";// 项目配置文件名 config
  public static final String VERIVYWORD = "verifyWord";// 验证码
  public static final String TOP_SYSMENU_CODE = "999999"; // 顶级菜单
  public static final String USER_OPER_ENABLE = "1"; // 用户启用操作标识
  public static final String USER_OPER_DISABLE = "0"; // 用户停用操作标识
  public static final String PCODE_INFOSTATUS_TRUE = "1"; // 是，有效，生效，在线
  public static final String PCODE_INFOSTATUS_FALSE = "0"; // 否，无效，注销，离线
  public static final String menu_Folder_Flag = "1"; // 菜单夹
  public static final String menu_Option_Flag = "2"; // 菜单项
  public static final String TREE_ROOT = "999999";// 根节点 组织机构 标准代码项一级几点
  public static final String YYMM = "yyyyMM"; // 时间格式
  public static final String BIRTHDAY_INIT = "9999-12-24"; // 初始化用户生日日期
  public static final String USER_INITPHOTO = "/phone/res/img/touxiang.jpg"; // 注册用户默认用户头像
  public static final String PHONE_IMGPATH = "/phone/res/file/img/"; // 客户端手机图片上传路径
  /**
   * * mongodb 对应配置文件里的key **
   */
  public static final String CONFIG = "public"; // 配置文件名
  public static final String MONGO_IP = "mongoDB.ip";// IP
  public static final String MONGO_PORT = "mongoDB.port";// 端口号
  public static final String MONGO_POOLSIZE = "mongoDB.poolSize";// 连接池大小
  public static final String MONGO_DBNAME = "mongoDB.dbName";// 数据库名
  public static final String MONGO_DBUSERNAME = "mongoDB.dbUserName";// 数据库用户名
  public static final String MONGO_DBPASSWORD = "mongoDB.dbPassWord";// 数据库密码
  /**
   * redis jedis 配置信息 *
   */
  public static final String MAXACTIVE = "redis.pool.maxActive";// 最大分配的对象数
  public static final String MAXIDLE = "redis.pool.maxIdle"; // 最大能够保持idel状态的对象数
  public static final String MAXWAIT = "redis.pool.maxWait"; // 等待时间
  public static final String TESTONBORROW = "redis.pool.testOnBorrow"; // 当调用borrow
                                                                       // Object方法时，是否进行有效性检查
  public static final String TESTONRETURN = "redis.pool.testOnReturn"; // #当调用return
                                                                       // Object方法时，是否进行有效性检查
  public static final String IP = "redis.ip"; // reids IP地址
  public static final String PORT = "redis.port"; // #reids Port
  /**
   * 邮件配置信息 **
   */
  public static final String EMAILHOST = "email_hostName"; // ssl://www.gmail.com
                                                           // 发件人所用到的服务器
  public static final String EMAILUSERNAME = "email_userName"; // 发件人帐号
  public static final String EMAILPASSWORD = "email_password"; // 发件人密码
  public static final String EMAILFROM = "email_emailFrom"; // 发件人地址
  public static final String NAMEFROM = "email_nameFrom"; // 发件人名称
  public static final String HOSTPROT = "email_hostProt";// 邮件服务器端口
  /**
   * 网站配置常量 *
   */
  public static final int TYPE_SJ1 = 1;//
  public static final int TYPE_SJ2 = 2;//
  public static final int TYPE_STATUS = 3;// 用户状态
  public static final int TYPE_SJ4 = 4;//
  public static final int TYPE_SJ5 = 5;//
  public static final int TYPE_SJ6 = 6;//
  public static final int TYPE_PL = 7;// 品类
  public static final int TYPE_BUSINESS = 8;// 商机
  public static final int TYPE_CENTER_BTN = 9;//个人中心按钮
  public static final int TYPE_DOC = 10;// 营销智库
  public static final int TYPE_MSG = 18;// 消息
  public static final int TYPE_HELP = 19;// 帮助中心
  public static final int TYPE_NEWS = 21;// 新闻中心
  public static final int TYPE_TJQY = 22;// 推荐企业
  public static final int TYPE_TJPP = 23;// 推荐品牌
  public static final int TYPE_HOTWORD = 24;// 搜索热词
  public static final int TYPE_FINDPWD = 25;//密码找回提示
  public static final int TYPE_REPORT = 30;//举报类型
  public static final int TYPE_PRODUCT = 31;// 产品中心
  public static final int TYPE_PRODUCTX = 43;// 产品中心
  public static final int TYPE_NOTICES = 44;// 通知通报中心
  
  public static final long SCORE_DOC_ADD = 4;// 上传文章赠送的积分
  public static final long SMONEY_LOGIN_APPROVED = 1; // 认证用户登录赠送的S币
  public static final long SMONEY_LOGIN_UNAPPROVED = 2; // 非认证用户登录赠送的S币
  public static final long SMONEY_BUSINESS_ADD = 3; // 上传商机赠送的S币
  public static final long SMONEY_BUSINESS_BUY = 6; // 购买商机赠送的积分
  public static final long SMONEY_REGISTER = 7; // 注册
  public static final long SMONEY_APPROVED = 8; // 认证
	public static final long MSG_DOC_UNPASS = 12;// 智库审核未通过

  public static ExecutorService uploadPool = Executors.newFixedThreadPool(20);// 全局线程池一
                                                                              // 文件上传处理类,RSSTask
  public static ExecutorService sendMailPool = Executors.newFixedThreadPool(80);// 全局线程池一
                                                                                // 邮件发送

  private GlobalConstant() {
  }

}
